/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ec.edu.espe.distribuidas.courier.modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author cHr15t14n
 */
@Entity
@Table(name = "costo_paquete")
public class CostoPaquete implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "ID_COSTO_PAQ", nullable = false)
    private Integer idCostoPaq;

    @Column(name = "RUBRO_COSTO_PAQ", nullable = false, precision = 8, scale = 2)
    private BigDecimal rubroCostoPaq;

    @Column(name = "DESCRIPCION_COSTO_PAQ", length = 501, nullable = true)
    private String descripcionCostoPaq;

    @Column(name = "VALOR_PACTADO_COSTO_PAQ", nullable = false, precision = 8, scale = 2)
    private BigDecimal valorPactadoCostoPaq;

    @Column(name = "VALOR_PAGADO_COSTO_PAQ", nullable = false, precision = 8, scale = 2)
    private BigDecimal valorPagadoCostoPaq;

    @Column(name = "PAGADO_COSTO_PAQ", nullable = false)
    private boolean pagadoCostoPaq;

    @JoinColumn(name = "ID_PAQUETE", referencedColumnName = "ID_PAQUETE")
    @ManyToOne
    private Paquete paquete;

    public CostoPaquete() {
    }

    public CostoPaquete(Integer idCostoPaq) {
        this.idCostoPaq = idCostoPaq;
    }

    public CostoPaquete(Integer idCostoPaq, int idPaquete, BigDecimal rubroCostoPaq, BigDecimal valorPactadoCostoPaq, BigDecimal valorPagadoCostoPaq, boolean pagadoCostoPaq) {
        this.idCostoPaq = idCostoPaq;
        this.rubroCostoPaq = rubroCostoPaq;
        this.valorPactadoCostoPaq = valorPactadoCostoPaq;
        this.valorPagadoCostoPaq = valorPagadoCostoPaq;
        this.pagadoCostoPaq = pagadoCostoPaq;
    }

    public Integer getIdCostoPaq() {
        return idCostoPaq;
    }

    public void setIdCostoPaq(Integer idCostoPaq) {
        this.idCostoPaq = idCostoPaq;
    }

    public Paquete getPaquete() {
        return paquete;
    }

    public void setPaquete(Paquete paquete) {
        this.paquete = paquete;
    }
    
    
    public BigDecimal getRubroCostoPaq() {
        return rubroCostoPaq;
    }

    public void setRubroCostoPaq(BigDecimal rubroCostoPaq) {
        this.rubroCostoPaq = rubroCostoPaq;
    }

    public String getDescripcionCostoPaq() {
        return descripcionCostoPaq;
    }

    public void setDescripcionCostoPaq(String descripcionCostoPaq) {
        this.descripcionCostoPaq = descripcionCostoPaq;
    }

    public BigDecimal getValorPactadoCostoPaq() {
        return valorPactadoCostoPaq;
    }

    public void setValorPactadoCostoPaq(BigDecimal valorPactadoCostoPaq) {
        this.valorPactadoCostoPaq = valorPactadoCostoPaq;
    }

    public BigDecimal getValorPagadoCostoPaq() {
        return valorPagadoCostoPaq;
    }

    public void setValorPagadoCostoPaq(BigDecimal valorPagadoCostoPaq) {
        this.valorPagadoCostoPaq = valorPagadoCostoPaq;
    }

    public boolean getPagadoCostoPaq() {
        return pagadoCostoPaq;
    }

    public void setPagadoCostoPaq(boolean pagadoCostoPaq) {
        this.pagadoCostoPaq = pagadoCostoPaq;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCostoPaq != null ? idCostoPaq.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CostoPaquete)) {
            return false;
        }
        CostoPaquete other = (CostoPaquete) object;
        if ((this.idCostoPaq == null && other.idCostoPaq != null) || (this.idCostoPaq != null && !this.idCostoPaq.equals(other.idCostoPaq))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ec.edu.espe.distribuidas.courier.modelo.CostoPaquete[ idCostoPaq=" + idCostoPaq + " ]";
    }

}
